

*REPLICATION FILE - ATTITUDES TOWARDS SECURITY OF DIGITAL INTRA-PARTY VOTING****

import excel "/Users/XXX/Data-replication.xlsx", sheet("Data") firstrow
********************************************************************************
** DEPENDENT VARIABLE: LEVEL OF CONCERN TOWARDS INTRA-PARTY VOTING *************
********************************************************************************
factor voting_a-voting_g

alpha (voting_a-voting_g), gen(voting_scale)
hist voting_scale, percent xline(2.6) title(Index of concern towards digital intra-party voting)
********************************************************************************
** INDEPENDENT VARIABLES *******************************************************
********************************************************************************
*** INDIVIDUAL-LEVEL ***********************************************************
********************************************************************************
**** Social groups more concerned by cybersecurity issues in general (H1) ******
encode gender, gen(Gender)

encode age, gen(Age)
label drop Age
recode Age (6=5) (5=1) (4=2) (3=3) (2=4) (1=5)
label define Age 1 "1990-2002" 2 "1980-1989" 3 "1970-1979" 4 "1960-1969" 5 "Before 1959" 
label values Age Age

gen Age_bin=.
replace Age_bin=0 if Age >= 3
replace Age_bin=1 if Age < 3
label define Age_bin 0 "pre-digital generations" 1 "digital-born generations"
label values Age_bin Age_bin

encode(education), gen(Education)
gen Education_3cat=.
replace Education_3cat = 1 if Education <= 3
replace Education_3cat = 2 if Education == 4
replace Education_3cat = 3 if Education == 5
label define Education_3cat 1 "low" 2 "middle" 3 "high"
label values Education_3cat Education_3cat

**** Status within the party (H2) **********************************************
encode(status), gen(Status)

**** Personal experience during COVID 19 (H3)***********************************
factor (covid1-covid5)
alpha(covid1-covid5), gen(Covid)

********************************************************************************
*** PARTY-LEVEL ****************************************************************
********************************************************************************
**** Moderate vs radical ideology (H4)  ****************************************
gen Ideology=.
replace Ideology=0 if (party_ideology == "Mainstream right") | (party_ideology == "Mainstream left")
replace Ideology=1 if (party_ideology == "Radical_right") | (party_ideology == "Radical_left")
label define Ideology 1 "Radical" 0 "Moderate"
label values Ideology Ideology

**** Party age: institutionalization before vs after digital turn (H5) *********
rename foundation_year = Party_age

**** Left vs right leaning ideology (H6) ***************************************
rename ches left_right

*** CONTROL VARIABLES **********************************************************
**** Membership size ***********************************************************
gen Membership=.
replace Membership=1 if (membership_raw < 15000) | (membership_raw == -999)
replace Membership=2 if (membership_raw >= 15000) & (membership_raw <30000)
replace Membership=3 if (membership_raw >= 30000) & (membership_raw <70000)
replace Membership=4 if (membership_raw >= 70000)
label define Membership 1 "Less than 15,000" 2 "From 15 to 29,999" 3 "From 30 to 70,000" 4 "More than 70,000" 
label values Membership Membership

**** Degree of representation in parliament ************************************
gen Representation = (seats_party/seats_total)*100
recode Representation (.=0) (100=0)

**** Country *******************************************************************
encode country, gen(Country)

********************************************************************************
** REGRESSION MODELS ***********************************************************
reg voting_scale ib(1).Gender Age ib(1).Education_3cat ib(1).Status Covid ib(0).Ideology Party_age left_right Membership Representation ib(3).Country
outreg2 using final_results.doc, replace ctitle (Main model) alpha(0.001, 0.01, 0.055) dec(2) ci

coefplot, xline (0) drop(_cons) groups(1.Gender 0.Age 1.Education_3cat 1.Status Covid = "{bf:Individual level}" 0.Ideology Party_age = "{bf:Party level}" Membership Representation Country = "{bf:Controls}") headings(1.Gender = "Gender" 1.Education_3cat = "Education" 1.Status = "Occupation" 0.Ideology = "Nature of party ideology", nogap) baselevel

reg voting_scale ib(1).Gender Age ib(1).Education_3cat ib(1).Status Covid ib(0).Ideology Party_age left_right Membership Representation ib(3).Country, beta
outreg2 using final_results.doc, append ctitle (Main model - beta) alpha(0.001, 0.01, 0.055) dec(2) ci

reg voting_scale ib(1).Gender Age ib(1).Education_3cat ib(1).Status Covid ib(0).Ideology Party_age left_right ib(1).Status#c.Age ib(0).Ideology#c.Party_age Membership Representation ib(3).Country 
outreg2 using final_results.doc, append ctitle (Main model w/ interaction) alpha(0.001, 0.01, 0.055) dec(2) ci

reg voting_scale ib(1).Gender Age ib(1).Education_3cat ib(1).Status Covid ib(0).Ideology Party_age left_right ib(1).Status#c.Age ib(0).Ideology#c.Party_age Membership Representation ib(3).Country, beta
outreg2 using final_results.doc, append ctitle (Main model w/ interaction - beta) alpha(0.001, 0.01, 0.055) dec(2) ci
